package cn.doctorpda.conference.update;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

/**
 * gson使用的封装
 * Created by sun on 14-3-11.
 */
public class BaiyyyGsonUtils {
    private static Gson gson = new Gson();

    public static <T> T fromJson(String json, TypeToken<T> token) {
        return (T) gson.fromJson(json, token.getType());
    }

    public static <T> T fromJson(String json, Class<T> clazz) {
        return (T) gson.fromJson(json, clazz);
    }

    public static String toJson(Object object){
        return gson.toJson(object);
    }
}
